<template>
  <div
    v-if="crud.props.searchToggle"
  >
    <el-input v-model="query.name" clearable size="small" placeholder="输入名称" style="width: 200px;" class="filter-item" @keyup.enter.native="crud.toQuery" />
    <el-select
      v-model="query.status"
      clearable
      size="small"
      placeholder="状态"
      class="filter-item"
      style="width: 90px"
      @change="crud.toQuery"
    >
      <el-option
        v-for="item in enabledTypeOptions"
        :key="item.key"
        :label="item.display_name"
        :value="item.key"
      />
    </el-select>
    <rrOperation
      :crud="crud"
    />
  </div>
</template>

<script>
  import { header } from '@crud/crud'
  import rrOperation from '@crud/RR.operation'
  export default {
    components: { rrOperation },
    mixins: [header()],
    props: {

      permission: {
        type: Object,
        required: true
      }
    },
    data() {
      return {
        enabledTypeOptions: [
          { key: 1, display_name: '待审核' },
          { key: 2, display_name: '审核通过' },
          { key: 3, display_name: '审核拒绝' }
        ]
      }
    }
  }
</script>
